package com.larry.isn.service;

import com.pegatron.ers.vo.common.CommonSQLStmt;

public class IsnService {

	public static CommonSQLStmt getSql(String table, String startDate, String endDate) {
		CommonSQLStmt stmt = new CommonSQLStmt();
		StringBuffer buf = new StringBuffer();
		buf.append("	select");
		buf.append("		apply_no,");
		buf.append("		serial_no serial_nr");
		buf.append("	from " + table);
		buf.append("	where");
		buf.append("		delete_no is null");
		buf.append("		and to_char(modify_date, 'yyyy/MM/dd')>='" + startDate + "'");
		buf.append("		and to_char(modify_date, 'yyyy/MM/dd')<='" + endDate + "'");
		buf.append("		and rma_center=34");
		buf.append("	group by serial_no, apply_no");
		System.out.println(buf.toString());
		stmt.setSql(buf.toString());
		return stmt;
	}
}
